<template>
  <div class="articles">
    <div @click="$router.push('/home/detail?id=' + uase.art_id)">
      <div class="top">
        <div class="title">{{ uase.title }}</div>
        <div class="img" v-if="uase.cover.type === 1">
          <img :src="uase.cover.images[0]" alt="" />
        </div>
      </div>
      <div class="content" v-if="uase.cover.type === 3">
        <img
          v-for="(item, index) in uase.cover.images"
          :key="index"
          :src="item"
          alt=""
        />
      </div>
    </div>
    <ul class="bottom">
      <li class="o1">{{ uase.aut_name }}</li>
      <li class="o1">{{ uase.comm_count }}评论</li>
      <li class="o1">{{ uase.pubdate | dateFormat() }}</li>
      <li class="o2">
        <i class="iconfont" @click="deleteid">&#xe749;</i>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ['uase'],
  methods: {
    deleteid () {
      this.$emit('closemain')
    }
  }
}
</script>

<style lang="less" scoped>
.articles {
  padding: 10px 0;
  .top {
    display: flex;
    justify-content: space-between;
    .title {
      font-size: 20px;
      font-weight: 700;
    }
    .img {
      text-align: right;
      img {
        width: 100px;
        height: 100px;
      }
    }
  }
  .content {
    display: flex;
    justify-content: space-between;
    img {
      width: 100px;
      height: 100px;
    }
  }
  .bottom {
    display: flex;
    align-items: center;
    margin-top: 10px;
    .o1 {
      font-size: 12px;
      color: #cccccc;
      margin-right: 20px;
    }
    .o2 {
      flex: 1;
      text-align: right;
      color: black;
      font-size: 20px;
    }
  }
}
</style>
